#include "projectsettings.h"
#include "ui_projectsettings.h"
#include "project.h"
#include "designerworkbench.h"

ProjectSettings::ProjectSettings(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::ProjectSettings)
{
    ui->setupUi(this);
    Project *project = QDesignerWorkbench::instance()->project();
    ui->editName->setText( project->projectName() );
    ui->editVersion->setText( project->version() );

}

ProjectSettings::~ProjectSettings()
{
    delete ui;
}

void ProjectSettings::done(int res)
{
    if( res == QDialog::Accepted ) {
        Project *project = QDesignerWorkbench::instance()->project();
        project->setProjectName( ui->editName->text() );
        project->setVersion( ui->editVersion->text() );
    }
    QDialog::done(res);
}
